﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MDIApplication
{
    public partial class RoomStatusReport : Form
    {
        public RoomStatusReport()
        {
            InitializeComponent();
        }

        private void RoomStatusReport_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'RmStatRptDataSet.Room' table. You can move, or remove it, as needed.
            this.RoomTableAdapter.Fill(this.RmStatRptDataSet.Room);

            this.reportViewer1.RefreshReport();
        }

        private void btnsearch_Click(object sender, EventArgs e)
        {
            this.RoomTableAdapter.FillByBoth(this.RmStatRptDataSet.Room, Convert.ToInt32(cbfloor.Text), Convert.ToString(cbstatus.Text));
            this.reportViewer1.RefreshReport();
        }

        private void cbstatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.RoomTableAdapter.FillByStatus(this.RmStatRptDataSet.Room, Convert.ToString(cbstatus.Text));
            this.reportViewer1.RefreshReport();
        }

        private void cbfloor_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.RoomTableAdapter.FillByLevel(this.RmStatRptDataSet.Room, Convert.ToInt32(cbfloor.Text));
            this.reportViewer1.RefreshReport();
        }

        private void btnviewall_Click(object sender, EventArgs e)
        {
            this.RoomTableAdapter.Fill(this.RmStatRptDataSet.Room);

            this.reportViewer1.RefreshReport();
        }

    }
}
